package com.huika.dealontop.control.pay.activity;

import android.content.Intent;
import android.view.View;
import android.widget.Button;

import com.huika.dealontop.R;
import com.huika.dealontop.control.base.BaseAct;
import com.huika.dealontop.control.myinfo.activity.MyOrderListActivity;
import com.huika.dealontop.support.event.PayEvent;
import com.huika.dealontop.views.TitleBarHelper;

import de.greenrobot.event.EventBus;

/**
 * Description:支付失败页面
 * Created by zhouweiyong on 2015/11/20.
 */
public class PayFailActivity extends BaseAct {
    private Button btn_apf;

    @Override
    public void setRootView() {
        setContentView(R.layout.activity_pay_fail);
    }

    @Override
    protected void initWidget() {
        TitleBarHelper titleBarHelper = new TitleBarHelper(this, R.string.title_pay_fail);
        titleBarHelper.setLeftMsg("");
        titleBarHelper.setOnLeftClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                onBackPressed();
            }
        });
        btn_apf = (Button) findViewById(R.id.btn_apf);
        btn_apf.setOnClickListener(this);
    }

    @Override
    public void widgetClick(View v) {
        EventBus.getDefault().post(new PayEvent(1));
        Intent intent = new Intent(this, MyOrderListActivity.class);
        intent.putExtra(MyOrderListActivity.CONTENTKEY,"1");
        startActivity(intent);
        PayFailActivity.this.finish();
    }

    @Override
    public void onBackPressed() {
        EventBus.getDefault().post(new PayEvent(1));
        super.onBackPressed();
    }
}
